$(function(){
	
//身份证正面
$('#uploadzm input').localResizeIMG({
    width: 200,
    quality: 1,
    success: function (result) {

        idcardBase = result.clearBase64;


//      alert("data:image/jpeg;base64," + idcardBase)
        idcardphoto1 = "data:image/jpeg;base64," + idcardBase;
        $("#uploadzm img").attr("src", "data:image/jpeg;base64," + idcardBase);
        
        $.ajax({
           type: "POST",
           url: "upload.php",
           data: idcardBase,
           dataType:"json",
           success: function(data){
             if (0 == data.status) {
//              alert(data.content);
                return false;
             }else{
//              alert(data.content);
                var attstr= '<img src="'+data.url+'" alt="" />'; 
                $(".imglist").append(attstr); 
             }
           }, 
            complete :function(XMLHttpRequest, textStatus){
            },
            error:function(XMLHttpRequest, textStatus, errorThrown){ //上传失败 
//             alert(XMLHttpRequest.status);
//             alert(XMLHttpRequest.readyState);
//             alert(textStatus);
            }
        }); 
        
    }
});


//身份证反面
$('#uploadfm input').localResizeIMG({
	width: 200,
	quality: 1,
	success: function(result) {

		idcardBase = result.clearBase64;

		//alert("data:image/jpeg;base64," + idcardBase)
		idcardphoto2 = "data:image/jpeg;base64," + idcardBase;
		
		$("#uploadfm img").attr("src", "data:image/jpeg;base64," + idcardBase);
		
		$.ajax({
           type: "POST",
           url: "upload.php",
           data: idcardBase,
           dataType:"json",
           success: function(data){
             if (0 == data.status) {
//              alert(data.content);
                return false;
             }else{
//              alert(data.content);
                var attstr= '<img src="'+data.url+'" alt="" />'; 
                $(".imglist").append(attstr); 
             }
           }, 
            complete :function(XMLHttpRequest, textStatus){
            },
            error:function(XMLHttpRequest, textStatus, errorThrown){ //上传失败 
//             alert(XMLHttpRequest.status);
//             alert(XMLHttpRequest.readyState);
//             alert(textStatus);
            }
        }); 
		
	}
});
	
	
	
});




